package com.ys.aspectjstudy;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Toast;

import com.ys.libaop.AopTest;
import com.ys.libaop.CustomPointCut;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        findViewById(R.id.tvTest).setOnClickListener(v -> {
            customMethod("刘智敏","刘菲特");
            new AopTest().test4PointCut("许超潜","许菲特");
        });

    }

    @CustomPointCut(permissionName = {"phone","network"})
    public void customMethod(String userName,String pwd) {
        Toast.makeText(this, "customMethod call", Toast.LENGTH_SHORT).show();
    }

}